package com.kitty.game.gm.handler100;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.equip.message.RespNotifyMiscEx;
import com.kitty.game.pet.model.Pet;
import com.kitty.game.role.model.Role;
import com.kitty.mina.message.MessagePusher;

public class NCWuxue implements NCGmFather {
    @Override
    public void handle(Role role, String content) {
        int matiral = Integer.parseInt(content);
        Pet pet = role.getPetBox().getPetByPetId(role.getPetBox().getFightPetId());
        if (pet == null){
            MessagePusher.pushMessage(role,new RespNotifyMiscEx("没有参战宠物"));
            return;
        }
        SpringUtils.getRoleService().addPetMatiral(role, pet, matiral);
        MessagePusher.pushMessage(role,new RespNotifyMiscEx("发送宠物武学成功"));
    }
}
